//
//  StoryListViewController.m
//  syl
//
//  Created by Chiu Chi Ho on 19/3/13.
//  Copyright (c) 2013 Chiu Chi Ho. All rights reserved.
//

#import "StoryListViewController.h"

@interface StoryListViewController ()

@end

@implementation StoryListViewController
@synthesize tableView = _tableView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
		
        // Custom initialization
		self.title = @"Story";
		
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
	
	UIBarButtonItem *sortByBtn = [[UIBarButtonItem alloc] initWithTitle:@"Name" style:UIBarButtonItemStyleBordered target:self action:@selector(sortByBtnDidClick:)];
	self.navigationItem.rightBarButtonItem = sortByBtn;
	[sortByBtn release];
}

- (void)viewDidUnload
{
	[_tableView release];
	
	[super viewDidUnload];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Selector
- (void)sortByBtnDidClick:(id)sender
{
	
}

#pragma mark - UITableViewDelegate

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
	return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *reuseIdentifer = @"Cell";
	
	UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifer];
	if (cell == nil) {
		cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifer] autorelease];
	}
	
	cell.textLabel.text = @"Story Name";
	cell.detailTextLabel.text = @"Not read";
	
	return cell;
}

@end
